package com.lesson9.decorator;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/8/31 9:15
 */
public class Decorator extends Drink
{
    private Drink obj;

    public Decorator(Drink obj)
    {
        this.obj = obj;
    }

    @Override
    public float cost()
    {
        return super.getPrice()+obj.cost();
    }

    @Override
    public String getDesc()
    {
        return super.getDesc()+" "+super.getPrice()+"&&"+obj.getDesc();
    }
}
